import Taro from "@tarojs/taro";
import { View, Text } from "@tarojs/components";
import "./load-more.less";
export default class Loadmore extends Taro.Component {
  static options = {
    addGlobalClass: true
  };

  constructor() {
    super(...arguments);
  }
  componentWillMount() {}

  render() {
    let loadNode;
    if (this.props.loadingMore === "loading") {
      loadNode = (
        <View className="weui-loadmore">
          <View className="weui-loading" />
          <View className="weui-loadmore__tips">正在加载</View>
        </View>
      );
    } else if (this.props.loadingMore === "noMore") {
      loadNode = (
        <View className="weui-loadmore weui-loadmore_line">
          <View className="weui-loadmore__tips weui-loadmore__tips_in-line">
            没有更多了
          </View>
        </View>
      );
    } else {
      loadNode = "";
    }
    return <View>{loadNode}</View>;
  }
}
